
*Code for Markov Switching model used in paper

use "/Users/006489466/Desktop/CA OIS/WaPoDataCA.dta"
tsline ois, tline(2020m1) yline(11.91)
*horizontal dashed line = average for entire series
* vertical dashed line shows when law went into effect.


* let's do some analysis
* check for stationarity
dfuller ois
* no unit root; stationary
pperron ois
*no unit root; stationar

* checking for autocorrelations
ac ois
* all lags w/i 95% CI
pac ois 
* all lags w/it 95% CI


regress ois
estat sbcusum
estat dwatson
estat bgodfrey
*no  sign of correlation. no sign of breaks in data either

* complexity not warranted; only one observed state
mswitch dr ois i.month, vce(robust) states(1)

mswitch dr ois i.month, vce(robust) states(2)
estat transition
estat duration

mswitch dr ois i.month, vce(robust) states(3)
estat transition
estat duration
